<template>
  <div>
    <div class="member">
      <router-link :to="{path:'/PersonalAll',query:{msg: 'PersonalMessage', name: '个人详细信息', flag: true, num: 4}}">
        <div class="member-pic">
          <img :src="img"/>
        </div>
      </router-link>
      <router-link :to="{path:'/PersonalAll',query:{msg: 'PersonalMessage', name: '个人详细信息', flag: true, num: 0}}">
        <div class="member-infor">{{name}}</div>
      </router-link>
    </div>
  </div>
</template>

<script>
  export default {
    name: "PersonalMember",
    data() {
      return {
        img: "",
        name: ""
      }
    },
    methods: {
      getData: function () {
        let _this = this;
        let token = _this.getCookie("token");
        _this.$http.get(_this.apiUrl("user/users/getInfo"), {headers: {'token': token}})
          .then((res) => {
            // console.log(res.data);
            _this.img = "http://new.ujnxgzx.com" + res.data.data.figure;
            _this.name = res.data.data.nick_name;
          });
      },
    },
    mounted() {
      let _this = this;
      _this.getData();
    },
  }
</script>

<style scoped>
  .member img {
    width: 80px;
    height: 80px;
    border-radius: 50px;
    margin-left: 20%;
  }

  .member-infor {
    float: right;
    margin-right: 20%;
  }
</style>
